import sys

from os.path import join, dirname

bl_info = {
    "name": "Render Master",
    "description": "可以对多个场景和产品进行匹配渲染,也能导入资产",
    "version": (1, 0),
    "blender": (4, 0, 0),
    "location": "顶部工具栏和偏好设置底部",
    "category": "Render",
    "author": "AIGODLIKE Community(BlenderCN辣椒,小萌新)",
}

addon_name = bl_info['name']
site_packages = join(dirname(__file__), 'rsc/lib')


def use_packages(): return site_packages in sys.path  # 已添加库路径


def add_path_to_system():
    """添加库路径模块
    """
    if not use_packages():
        sys.path.append(site_packages)


def del_path_from_system():
    if use_packages():
        sys.path.remove(site_packages)


def register():
    add_path_to_system()
    from . import utils
    utils.register()


def unregister():
    from . import utils
    utils.unregister()

    del_path_from_system()
